spl: nand: sunxi: create an helper to handle command execution
authorMiquel Raynal <[email protected]>
Wed, 28 Feb 2018 19:51:50 +0000 (20:51 +0100)
committerMaxime Ripard <[email protected]>
Tue, 3 Apr 2018 10:11:17 +0000 (12:11 +0200)
commita084cb6664e0de40f33da1c8ec6de816a9852f6d
tree8128a66e6e35f1dbdba3def90f4926c0b58e5263
parent781e70cff12916ae6698cc77a22e0ce687f39e3b
spl: nand: sunxi: create an helper to handle command execution

Executing a command is matter of always doing the following sequence:
  * Waiting for the FIFO to be empty so we can fill it with the new
    command.
  * Clearing the status register.
  * Writing the command in the FIFO.
  * Waiting for the command to finish.

Add a nand_exec_cmd() helper to handle this instead of repeating the
logic through the various functions.

Signed-off-by: Miquel Raynal <[email protected]>
Acked-by: Boris Brezillon <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
drivers/mtd/nand/sunxi_nand_spl.c